package cn.leaf.controller;

import cn.leaf.req.MsgReq;
import cn.leaf.service.MessageService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 *
 * description: 消息控制层
 *
 * @author Cyril
 * @version v1.0.0
 * @since 2021-05-20 21:31:42
 *
 */
@Validated
@RestController
@RequestMapping(value = "msg")
public class MessageController {

    @Resource
    private MessageService messageService;

    @PostMapping
    public void sendMsg(@RequestBody @Valid MsgReq req) {
        messageService.sendMessage(req);
    }
}


